using MQTTnet.Extensions.ManagedClient;

namespace PHMEE.VibrationDataGenerator.Services;

public class MqttClientWrapper : IDisposable
{
    private readonly MqttClientPool _pool;
    public IManagedMqttClient Client { get; }

    public MqttClientWrapper(MqttClientPool pool, IManagedMqttClient client)
    {
        _pool = pool;
        Client = client;
    }

    public void Dispose()
    {
        _pool.ReleaseClient(Client);
    }
}